{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="form-group">
        <label class="col-sm-2 control-label">文章标题</label>
        <div class='col-sm-8'>
            <input autofocus name="title" value='{$vo.title|default=""}' required="required" title="文章标题" placeholder="文章标题" class="layui-input">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">所属分类</label>
        <div class='col-sm-8'>
            <select name='cid' class='layui-select full-width' lay-ignore>
                <!--{foreach $data as $menu}-->
                <!--{eq name='menu.id' value='$vo.cid|default=0'}-->
                <option selected value='{$menu.id}'>{$menu.title}</option>
                <!--{else}-->
                <option value='{$menu.id}'>{$menu.title}</option>
                <!--{/eq}-->
                <!--{/foreach}-->
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">浏览量</label>
        <div class='col-sm-8'>
            <input autofocus name="view" value='{$vo.view|default=""}' pattern="^[0-9]{1,}$"  title="请输入正确的浏览量" placeholder="浏览量" class="layui-input">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">文章封面</label>
        <div class='col-sm-8'>
            <div class="col-sm-9 padding-left-0">
                <input style="border-right:none" name="thumb" value="{$vo.thumb|default=''}" class="layui-input" title="请输入链接或上传图片文件" placeholder="请输入链接或上传图片文件">
            </div>
            <div class="col-sm-3 padding-left-0">
                <button data-file="one"  data-field="thumb" type="button" class="layui-btn layui-btn-sm" style="height:38px;line-height:38px;width:100%">上传图片文件</button>
            </div>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">文章描述</label>
        <div class='col-sm-8'>
            <textarea placeholder="请输入文章描述" title="请输入文章描述" class="layui-textarea" name="generalize">{$vo.generalize|default=""}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">文章内容</label>
        <div class='col-sm-8'>
            <textarea name="content">{$vo.content|default=''|raw}</textarea>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">保存配置</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消编辑</button>
        </div>
    </div>

    <script>window.form.render();</script>

    <script>
        /*! 实例富文本编辑器  */
        require(['ckeditor'], function () {
            window.createEditor('[name="content"]', {height: 500});
        });
    </script>
</form>
{/block}